import inspect

class create_module():
    def __init__(self, cls):
        self._cls = cls  # 只存cls
        frame = inspect.currentframe().f_back
        args, _, _, values = inspect.getargvalues(frame)
        self._params = {}
        for arg in args:
            if arg not in ('self', 'cls'):  # 自动搜集除了 self 和 cls 的其他参数
                self._params[arg] = values[arg]
    
    def __call__(self):
        return self._cls(**self._params)
